#include "MyTestCommandTool.h"
#include "OCMain/Log.h"
#include "MyTestCommandToolCallEnum.h"

#include "CommandTool/ASCToBin.h"
#include "CommandTool/CSVToJson.h"
#include "CommandTool/VdbToBin.h"
#include "CommandTool/ExtractGrib.h"
#include "CommandTool/ExtractISO.h"
#include "CommandTool/MK_Algorithm.h"

using namespace OCPP;

void MyTestCommandTool::call(std::any& options)
{
	if (options.has_value() && options.type() == typeid(int))
	{
		int callId = std::any_cast<int>(options);
		auto callEnum = magic_enum::enum_cast<MyTestCommandToolCallEnum>(callId).value();
		auto callName = magic_enum::enum_name(callEnum).data();
		OCPP_LOG_INFO << callName << "\n";
		if (MyTestCommandToolCallEnum::ASCToBin == callEnum) {
			ASCToBin();
		}		
		else if (MyTestCommandToolCallEnum::ExtractGrib == callEnum) {
			ExtractGrib();
		}
		else if (MyTestCommandToolCallEnum::CSVToJson == callEnum) {
			CSVToJson();
		}
		else if (MyTestCommandToolCallEnum::VdbToBin == callEnum) {
			VdbToBin();
		}
		else if (MyTestCommandToolCallEnum::ExtractISO == callEnum) {
			ExtractISO();
		}
		else if (MyTestCommandToolCallEnum::MK_Algorithm == callEnum) {
			MK_Algorithm();
		}
	}
}
